package com.bright.ghj.common.exception;

import com.bright.ghj.common.enums.ResultStatus;

/**
 * @Author txf
 * @Date 2023/11/30 14:20
 * @Description 应用程序异常
 */
public class ApplicationException extends RuntimeException {

    private Integer code;
    private String message;

    public ApplicationException() {
        super();
    }

    public ApplicationException(String message) {
        super(message);
        this.code = ResultStatus.SERVER_ERROR.getCode();
        this.message = message;
    }

    public ApplicationException(ResultStatus resultStatus) {
        super(resultStatus.getMessage());
        this.code = resultStatus.getCode();
        this.message = resultStatus.getMessage();
    }
}

